package com.yunzheng.studyLeaveSystem.modules.user.adjust.record.service;

import com.yunzheng.studyLeaveSystem.modules.user.adjust.adjust.entity.Adjust;
import com.yunzheng.studyLeaveSystem.modules.user.adjust.record.dao.RecordDao;
import com.yunzheng.studyLeaveSystem.modules.user.adjust.record.entity.AdjustRecord;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: YunZheng
 * @Date: 2023/01/29/12:31
 * @Description:
 */
public class RecordService {
    private RecordDao recordDao = new RecordDao();

    public List<AdjustRecord> record(int id) throws SQLException {
        return recordDao.record(id);
    }

    public Boolean deleteAdjust(String name, String term, String direction, Date leave_date) throws SQLException {
        Boolean status = true;
        if (recordDao.deleteAdjust(name, term, direction, leave_date)) {
            return status;
        }
        return false;
    }
    public int quaryAdjustNum(int id) throws Exception {
        return recordDao.quaryAdjustNum(id);
    }
}
